#for 循环输出九九乘法表，四种格式
#九九乘法表，三角形左对齐，每一行都从1*i开始
for j in range(1,10):
    for i in range(1,j+1):
        print("{}*{}={:<3}".format(i,j,i*j), end = " ")
    print("")

print('='*72)
#九九乘法表，倒三角形，左对齐，每一行都从1*i开始
for j in range(9,0,-1):
    for i in range(1,j+1):
        print("{}*{}={:<3}".format(i,j,i*j), end = " ")
    print("")

#九九乘法表 三角形，右对齐
for i in range(1,10):
    print(" "*8*(9-i),end = " ")#输出空白，保持每行左对齐
    for j in range(i,0,-1):
        print("{0:>2}*{1}={2:^2}".format(j,i,i*j),end =" ")
    print("")
print('='*72)
#九九乘法表 倒三角形，右对齐
for i in range(9,0,-1):
    print(" "*8*(9-i),end = " ")#输出空白，保持每行左对齐
    for j in range(i,0,-1):
        print("{0:>2}*{1}={2:^2}".format(j,i,i*j),end =" ")
    print("")